const {resolve} = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
    entry: "./src/index.js",
    // entry: ["./src/index.js", "./src/main.js"],
    // entry: {
    //     one: './src/index.js',
    //     two: './src/main.js'
    // },
    // entry: {
    //     onea: ['./src/main.js','./src/index.js'],
    //     twob: './src/index.js'
    // },

    output: {
        filename: "[name].js",
        path: resolve(__dirname, 'build')
    },

    //打包非js文件以外的资源
    module: {
        rules: []
    },

    plugins: [
        new HtmlWebpackPlugin({
            template: "./src/index.html",
            filename: "demo.html",
            minify: true
        })
    ],

    mode: "development"
};